<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
/*******basic*******/
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		if(intval($postdata['groupdiscount'])<1 || $postdata['groupdiscount']>99){
			exi('拼单折扣必须在1~100范围内','error');
		}
		$this->plugin_setting('basic',$postdata);
		exi('设置成功');
	}
	$bankuai =array(
		array('title'=>'每日清仓','img'=>'../addons/jy_weishop/resource/mobile/images/icon/qingcang.png','action'=>'jy_pingdd/index/'),
		array('title'=>'品牌馆','img'=>'../addons/jy_weishop/resource/mobile/images/icon/pinpai.png','action'=>'jy_pingdd/index/'),
		array('title'=>'9块9特卖','img'=>'../addons/jy_weishop/resource/mobile/images/icon/9.9.png','action'=>'jy_pingdd/index/'),
		array('title'=>'找折扣','img'=>'../addons/jy_weishop/resource/mobile/images/icon/zhekou.png','action'=>'jy_pingdd/index/'),
		array('title'=>'时尚穿搭','img'=>'../addons/jy_weishop/resource/mobile/images/icon/shishang.png','action'=>'jy_pingdd/index/'),
		array('title'=>'爱逛街','img'=>'../addons/jy_weishop/resource/mobile/images/icon/guangjie.png','action'=>'jy_pingdd/index/'),
		array('title'=>'食品超市','img'=>'../addons/jy_weishop/resource/mobile/images/icon/shopping.png','action'=>'jy_pingdd/index/'),
		array('title'=>'电器城','img'=>'../addons/jy_weishop/resource/mobile/images/icon/jiadian.png','action'=>'jy_pingdd/index/'),
		array('title'=>'领券中心','img'=>'../addons/jy_weishop/resource/mobile/images/icon/coupon.png','action'=>'jy_weishop/coupon.index/'),
	);
	$footernav = array(
			array('title'=>'首页','icon'=>'icon-shouye','color'=>'#cc99ff','action'=>'jy_pingdd/index/','image'=>'../addons/jy_weishop/resource/images/jy_weishoparticle.png'),
			array('title'=>'推荐','icon'=>'icon-viewlist','color'=>'#66cc99','action'=>'jy_pingdd/goods.index/','image'=>'../addons/jy_weishop/resource/images/jy_fenleimsg.png'),
			array('title'=>'搜索','icon'=>'icon-compass','color'=>'#ff9933','action'=>'jy_pingdd/groups/','image'=>'../addons/jy_weishop/resource/images/jy_fenleimsg.png'),
			array('title'=>'拼单','icon'=>'icon-yonghujieru','color'=>'#66cc66','action'=>'jy_pingdd/myteam/','image'=>'../addons/jy_weishop/resource/images/jy_fenleimsg.png'),
			array('title'=>'我的','icon'=>'icon-wo1','color'=>'#FF83FA','action'=>'jy_pingdd/myhome/','image'=>'../addons/jy_weishop/resource/images/jy_fenleimsg.png'),
	);
	$hdps =array(
		array('title'=>'1','picurl'=>'../addons/jy_pingdd/resource/images/hdp01.jpg'),
		array('title'=>'2','picurl'=>'../addons/jy_pingdd/resource/images/hdp02.jpg'),
	);
	$return['item']=$this->plugin_setting('basic');
	$return['item']['isset']=1;
	$return['item']['indexad']=$return['item']['indexad']?$return['item']['indexad']:'../addons/jy_pingdd/resource/images/indexad.jpeg';
	$return['item']['bankuai']=$return['item']['bankuai']?$return['item']['bankuai']:$bankuai;
	$return['item']['footernav']=$return['item']['footernav']?$return['item']['footernav']:$footernav;
	$return['item']['hdps']=$return['item']['hdps'] || $return['item']['isset']?$return['item']['hdps']:$hdps;
	$htmls=array(
		'type'=>'edit',
		'desc'=>'参数设置',
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'基本信息',
				'list'=>array(
					array('type'=>'tip','title'=>'[温馨提示]：前端只显示商品设置了【拼单价】【拼单数】的商品！'),
					array('type'=>'string','title'=>'网站名称','name'=>'title'),
					array('type'=>'image','title'=>'网站logo','name'=>'logo'),
					array('type'=>'image','title'=>'网站ICO','name'=>'icon'),
					array('type'=>'image','title'=>'首页顶部背景','name'=>'topbg','help'=>'高380，宽750'),
					array('type'=>'image','title'=>'首页横幅广告','name'=>'indexad','help'=>'高160，宽750'),
					array('type'=>'unitstring','unit'=>'%','title'=>'默认拼单%','name'=>'groupdiscount','help'=>'如果商品没用单独设置拼单折扣，就用默认折扣！'),
					array('type'=>'string','title'=>'分享标题','name'=>'share_title'),
					array('type'=>'image','title'=>'分享图片','name'=>'share_image'),
					array('type'=>'string','title'=>'分享描述','name'=>'share_desc'),
				)
			),
			array(
					'title'=>'拼单规则',
					'list'=>array(
						array('type'=>'richtext','title'=>'拼单规则','name'=>'rules','help'=>''),
					)
			),
			array(
					'title'=>'界面UI配色',
					'list'=>array(
						array('type'=>'color_pool','title'=>'选择配色方案','name'=>'syscolor','help'=>''),
						array('type'=>'colorpicker','title'=>'站点颜色','name'=>'syscolor','help'=>'自定义系统颜色系，默认： #18bc9c'),
						array('type'=>'phone_tpl','name'=>'syscolor'),
					)
			),
			array(
				'title'=>'幻灯片',
					'list'=>array(
						array(
							'type'=>'array',
							'name'=>'hdps',
							'add_tip'=>'添加一个幻灯片',
								'list'=>array(
									array('type'=>'image','name'=>'picurl','title'=>'幻灯片图片'),
									array('type'=>'string','name'=>'url','title'=>'幻灯片链接'),
									
								),
								'details'=>array(
									array('type'=>'image','name'=>'picurl','title'=>'幻灯片图片','help'=>''),
									array('type'=>'string','name'=>'url','title'=>'幻灯片链接'),
									
								)
						)
					)
			),
			array(
				'title'=>'板块导航',
					'list'=>array(
									array('type'=>'array','name'=>'bankuai','add_tip'=>'添加一个板块导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'image','name'=>'img','title'=>'导航图片'),
										array('type'=>'string','name'=>'action','title'=>'导航链接'),							
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'image','name'=>'img','title'=>'导航图片'),							
										array('type'=>'string','name'=>'action','title'=>'导航链接'),
									)
								),
					)
			),
			array(
				'title'=>'底部导航',
					'list'=>array(
									array('type'=>'array','name'=>'footernav','add_tip'=>'添加一个底部导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),
										array('type'=>'string','name'=>'action','title'=>'导航链接'),							
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标','help'=>'图标，例如：icon-shouye'),							
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接'),
									)
								),
					)
			),
		),
	);
	$return['htmls']=$htmls;
	exi($return);
}
/*******basic*******/
/*******op*******/
